package com.taojin.shoppinginterest.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import java.util.List;

/**
 * Created by T400 on 15-5-11.
 */
public class HomeFragmentAdapter extends FragmentPagerAdapter{
    private List<Fragment> fragments;

    public HomeFragmentAdapter(List<Fragment> fragments,FragmentManager fm) {
        super(fm);
        this.fragments=fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return !fragments.isEmpty()?fragments.size():0;
    }


}
